package org.bite.book_controller.dao;

import org.bite.book_controller.model.BookInfo;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Component
public class BookDao {
    public List<BookInfo> mockData() {
        List<BookInfo> BookList = new ArrayList<BookInfo>();
        for(int i = 0; i < 15 ;i++){
            BookInfo book = new BookInfo();
            book.setId(i);
            book.setBookName("图书"+i);
            book.setAuthor("作者"+i);
            book.setCount(i*15);
            book.setPublish("出版社"+i);
            book.setStatus(i%5==0?2:0);
            book.setPrice(new BigDecimal(22*i));
            BookList.add(book);
        }
        return BookList;
    }
}
